Skip to content

Support variants (types defined with '#type')#4

Closed
bloeys wants to merge 1 commit intotsoding:masterfrom
bloeys:variant-support
Closed

Support variants (types defined with '#type')#4
bloeys wants to merge 1 commit intotsoding:masterfrom
bloeys:variant-support

Conversation

@bloeys
Copy link

@bloeys bloeys commented Feb 5, 2026

Hey,

hope you are doing well!

This is a small PR to add support for type variants (e.g., Id :: #type,distinct int) when parsing or producing JSON.
I also added tests for this.

Btw I do not think variant_of can ever be null, but if yes, then we need to adjust the while loop to check info for null first.

Side note: I expect a loop similar to this approach for pointer handling should be a bit faster than the current dereference-by-recursion.

Thanks :)

@bloeys
Copy link
Author

bloeys commented Feb 11, 2026

I meant to send this to the main Jaison repo. Sorry!

@bloeys bloeys closed this Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant